package com.interpreter.pattern.service.impl;

import com.interpreter.pattern.service.Expression;

/**
 * @author chenchen
 * @description
 * @date 2023/11/20 11:20
 */
public class TerminalExpression implements Expression {

    private final String data;

    public TerminalExpression(String data){
        this.data = data;
    }

    @Override
    public boolean interpret(String context) {
        if(context.contains(data)){
            return true;
        }
        return false;
    }
}
